home *** CD-ROM | disk | FTP | other *** search
- #define CURSES_LIBRARY 1
- #include <curses.h>
- #undef wclrtobot
-
- #ifdef PDCDEBUG
- char *rcsid_wclrtobo = "$Header: C:\CURSES\portable\RCS\wclrtobo.c 2.1 1993/06/18 20:19:20 MH Rel MH $";
- #endif
-
-
-
-
- /*man-start*********************************************************************
-
- wclrtobot() - erase window
-
- X/Open Description:
- All lines below the cursor in this window are erased. The current
- line to the right of the cursor, inclusive, is also erased.
-
- NOTE: clrtobot() is a macro.
-
- PDCurses Description:
- There is no additional PDCurses functionality.
-
- X/Open Return Value:
- The wclrtobot() function returns OK on success and ERR on error.
-
- PDCurses Errors:
- It is an error to call this function with a NULL window pointer.
-
- Portability:
- PDCurses int wclrtobot( WINDOW* win );
- X/Open Dec '88 int wclrtobot( WINDOW* win );
- BSD Curses int wclrtobot( WINDOW* win );
- SYS V Curses int wclrtobot( WINDOW* win );
-
- **man-end**********************************************************************/
-
- int wclrtobot(WINDOW *win)
- {
- int y;
- int minx;
- int startx;
- chtype blank;
- chtype* ptr;
- chtype* end;
- chtype* maxx;
-
- #ifdef PDCDEBUG
- if (trace_on) PDC_debug("wclrtobot() - called\n");
- #endif
-
- if (win == (WINDOW *)NULL)
- return( ERR );
-
- blank = win->_blank | win->_attrs;
- startx = win->_curx;
-
- for (y = win->_cury; y <= win->_bmarg; y++)
- {
- minx = _NO_CHANGE;
- end = &win->_y[y][win->_maxx - 1];
- for (ptr = &win->_y[y][startx]; ptr <= end; ptr++)
- {
- if (*ptr != blank)
- {
- maxx = ptr;
- if (minx == _NO_CHANGE)
- {
- minx = (int) (ptr - win->_y[y]);
- }
- *ptr = blank;
- }
- }
- if (minx != _NO_CHANGE)
- {
- if ((win->_firstch[y] > minx) ||
- (win->_firstch[y] == _NO_CHANGE))
- {
- win->_firstch[y] = minx;
- if (win->_lastch[y] < maxx - win->_y[y])
- {
- win->_lastch[y] = (int) (maxx - win->_y[y]);
- }
- }
- }
- startx = 0;
- }
- return( OK );
- }
-